<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="/css/common/add.css"/>
<script type="text/javascript" src="${ctx}/plugin/jquery/jquery-2.1.1.js"></script>
<script type="text/javascript" src="${ctx}/plugin/jquery/jquery.form.js"></script>
<script type="text/javascript" src="${ctx}/plugin/jquery/jquery-validation/jquery.validate.min.js"></script>
<script type="text/javascript" src="${ctx}/plugin/layer-v1.9.2/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/common/common.js"></script>
<script type="text/javascript" src="${ctx}/js/task/scoreCheck.js"></script>
<body>
<div class="l_err" style="wid 100%; margin-top: 2px;"></div>
<form id="form" name="form" class="form-horizontal" method="post"
      action="/taskManage/addScore"
      enctype="multipart/form-data">
    <input id="dataUrl" value="${dataUrl}" type="hidden"/>
    <input id="checkId" name="checkId" value="${checkId}" type="hidden"/>
    <input id="responsibilityCorpPersonIds" name="responsibilityCorpPersonIds" value="" type="hidden"/>
    <section class="">
        <div class="score-title">
            <input type="hidden" id="check-btn-value" value=""/>
            <input type="hidden" id="scoreType" value="${scoreType}"/>
        <#if scoreType!=2 >
            <button id="deduction" type="button" class="top-button-list check-btn">扣分</button>
        </#if>
        <#if scoreType!=1 >
            <button id="score" type="button" class="top-button-list">得分</button>
        </#if>

        </div>
        <div class="form-layer-group clearfix add-main">
        <#if taskType == '1' >
            <div class="form-group-div form-layer-input clearfix" id="deductionDiv">
                <button type="button" id="deduction-num-reduce" class="btn top-btn-cancel">减</button>
                <input class="input-medium-middle" name="deductionNum" id="deductionNum" value="${weighting}"
                       type="text"/>
                <button type="button" id="deduction-num-plus" class="btn top-btn-main">加</button>
            </div>

            <div class="form-group-div form-layer-input clearfix" id="scoreDiv" style="display: none;">
                <button type="button" id="score-num-reduce" class="btn top-btn-cancel">减</button>
                <input class="input-medium-middle" id="scoreNum" name="scoreNum" value="${weight1}" type="text"/>
                <button type="button" id="score-num-plus" class="btn top-btn-main">加</button>
            </div>
        <#else >
            <div class="form-group-div form-layer-input clearfix" id="deductionDiv">
                <input class="input-medium-middle" disabled name="deductionNum" id="deductionNum" value="${weighting}"
                       type="text"/>
            </div>

            <div class="form-group-div form-layer-input clearfix" id="scoreDiv" style="display: none;">
                <input class="input-medium-middle" disabled id="scoreNum" name="scoreNum" value="${weight1}"
                       type="text"/>
            </div>
        </#if>
            <div style="height: 30px"></div>

            <div id="deduction-corp-div" class="form-layer-group ">
                <label class="control-label">主要责任单位：</label>
            <#if mainResponsibilityList?? && mainResponsibilityList?size gt 0>
                <#list mainResponsibilityList as child>
                    <div class="form-group-div form-layer-input clearfix">
                        <select data_id="${child.id}" class="input-medium-two form-control m-b main-responsibility"
                                onchange="getResponsibilityPersonList(this.options[this.options.selectedIndex].value,'mainResponsibilityPerson${child.id}','${child.id}')"
                                id="mainResponsibilityCrop${child.id}">
                        </select>
                        <select class="input-medium-two form-control m-b"
                                id="mainResponsibilityPerson${child.id}">
                        </select>
                    </div>
                </#list>
            </#if>
            <#if secondaryResponsibilityList?? && secondaryResponsibilityList?size gt 0>
                <label class="control-label">次要责任单位：</label>
                <#list secondaryResponsibilityList as child>

                    <div class="form-group-div form-layer-input clearfix">

                        <select class="input-medium-two form-control m-b secondary-responsibility"
                                onchange="getResponsibilityPersonList(this.options[this.options.selectedIndex].value,'secondaryResponsibilityPerson${child.id}','${child.id}')"
                                data_id="${child.id}"
                                id="secondaryResponsibilityCrop${child.id}">
                        </select>
                        <select class="input-medium-two form-control m-b"
                                id="secondaryResponsibilityPerson${child.id}">
                        </select>
                    </div>
                </#list>
            </#if>
            <#if relevantResponsibilityList?? && relevantResponsibilityList?size gt 0>
                <label class="control-label">相关责任单位：</label>
                <#list relevantResponsibilityList as child>

                    <div class="form-group-div form-layer-input clearfix">

                        <select class="input-medium-two form-control m-b relevant-responsibility" data_id="${child.id}"
                                onchange="getResponsibilityPersonList(this.options[this.options.selectedIndex].value,'relevantResponsibilityPerson${child.id}','${child.id}')"
                                id="relevantResponsibilityCrop${child.id}">
                        </select>
                        <select class="input-medium-two form-control m-b"
                                id="relevantResponsibilityPerson${child.id}">
                        </select>
                    </div>
                </#list>
            </#if>
            </div>

            <div id="score-corp-div" style="display: none;"  class="form-layer-group">
                <label class="control-label">主要责任单位：</label>
            <#if mainResponsibilityListPlus?? && mainResponsibilityListPlus?size gt 0>
                <#list mainResponsibilityListPlus as child>
                    <div class="form-group-div form-layer-input clearfix">
                        <select data_id="${child.id}" class="input-medium-two form-control m-b main-responsibility"
                                onchange="getResponsibilityPersonList(this.options[this.options.selectedIndex].value,'mainResponsibilityPerson${child.id}','${child.id}')"
                                id="mainResponsibilityCrop${child.id}">
                        </select>
                        <select class="input-medium-two form-control m-b"
                                id="mainResponsibilityPerson${child.id}">
                        </select>
                    </div>
                </#list>
            </#if>
            <#if secondaryResponsibilityListPlus?? && secondaryResponsibilityListPlus?size gt 0>
                <label class="control-label">次要责任单位：</label>
                <#list secondaryResponsibilityListPlus as child>

                    <div class="form-group-div form-layer-input clearfix">

                        <select class="input-medium-two form-control m-b secondary-responsibility"
                                onchange="getResponsibilityPersonList(this.options[this.options.selectedIndex].value,'secondaryResponsibilityPerson${child.id}','${child.id}')"
                                data_id="${child.id}"
                                id="secondaryResponsibilityCrop${child.id}">
                        </select>
                        <select class="input-medium-two form-control m-b"
                                id="secondaryResponsibilityPerson${child.id}">
                        </select>
                    </div>
                </#list>
            </#if>
            <#if relevantResponsibilityListPlus?? && relevantResponsibilityListPlus?size gt 0>
                <label class="control-label">相关责任单位：</label>
                <#list relevantResponsibilityListPlus as child>

                    <div class="form-group-div form-layer-input clearfix">

                        <select class="input-medium-two form-control m-b relevant-responsibility" data_id="${child.id}"
                                onchange="getResponsibilityPersonList(this.options[this.options.selectedIndex].value,'relevantResponsibilityPerson${child.id}','${child.id}')"
                                id="relevantResponsibilityCrop${child.id}">
                        </select>
                        <select class="input-medium-two form-control m-b"
                                id="relevantResponsibilityPerson${child.id}">
                        </select>
                    </div>
                </#list>
            </#if>
            </div>
            <div style="text-align: center;padding:12px 0px">
                <button type="button" class="cancel btn btn-cancel">取消</button>
            <#if taskType == '1' >
                <button type="submit" id="submitButton" class="btn btn-main">确定</button>
            </#if>
            </div>
        </div>
    </section>
</form>
</body>
<script>
    $(function () {debugger
        var scoreType = $("#scoreType").val();
        if (scoreType == 2) {
            $('#score').trigger("click");
        }
    });
</script>
</html>
